/*************************************************************************
	> File Name: oj-520_等式.cpp
	> Author: Wang Bo
	> Mail: 1276106221@qq.com
	> Created Time: 2021年02月07日 星期日 15时15分39秒
 ************************************************************************/
#include <iostream>
using namespace std;
using ll = long long;
#define MAX_N 15000000
ll a, num[MAX_N + 5], n, k;

int main() {
    cin >> a;
    for (int i = 1; i <= MAX_N; ++i) {
        num[i] = num[i - 1] + i; //存成前缀和，方便比较计算
    }
    for (int i = a; 1; ++i) {
        int l = i + 1, r = MAX_N, mid;
        while (l <= r) {
            mid = (l + r) >> 1;
            if (num[mid] - num[i] == num[i - 1]) {
                cout << i << " " << mid << endl;
                return 0;
            }
            if (num[mid] - num[i] > num[i - 1]) {
                r = mid - 1;
            } else {
                l = mid + 1;
            }
        }
    }
    return 0;
}
